package com.kzhkwkt.sugoieditor;

import android.content.res.Configuration;
import android.widget.EditText;

public class PreferenceAdmin {

	SugoiEditor activity = null;

	PreferenceAdmin(SugoiEditor activity) {
		this.activity = activity;
	}

	public void setColor(EditText edit, boolean flag) {
		if(flag) {
    		edit.setBackgroundColor(activity.getResources().getColor(R.color.background_reverse));
    		edit.setTextColor(activity.getResources().getColor(R.color.text_reverse));
		}
		else {
    		edit.setBackgroundColor(activity.getResources().getColor(R.color.background_default));
    		edit.setTextColor(activity.getResources().getColor(R.color.text_default));
		}
	}

	public void setOrientation(boolean flag) {
		if(flag) {
			activity.setRequestedOrientation(Configuration.ORIENTATION_PORTRAIT);
		}
    	else {
    		activity.setRequestedOrientation(Configuration.ORIENTATION_SQUARE);
    	}
	}
}
